package com.binance.assetservice.web.controller;

import org.javasimon.aop.Monitored;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.binance.assetservice.api.ITranApi;
import com.binance.assetservice.vo.request.GetTranRequest;
import com.binance.assetservice.web.service.ITranService;
import com.binance.master.models.APIRequest;
import com.binance.master.models.APIResponse;

@RestController
@Monitored
public class TranController implements ITranApi{

    @Autowired
    private ITranService tranService;

	@Override
	public APIResponse<Long> getTranId(@Validated @RequestBody APIRequest<GetTranRequest> request) throws Exception {
		return APIResponse.getOKJsonResult(tranService.insert(request.getBody())) ;
	}

}
